﻿using Jayden.Dll.OpenGL;
using Jayden.Dll.Tetris;
using OpenTK;
using OpenTK.Graphics.OpenGL;

namespace Tetris
{
	public class TetrisGameWindow : GameWindow
	{

		public void DrawModel(GameModel model)
		{
			GL.PushMatrix();
			for (int c = 0; c < model.Width; c++)
			{
				GL.PushMatrix();
				for (int d = 0; d < model.Height; d++)
				{
					Block block = model.Get(c, d);
					if (block != null)
					{
						Helper.Cube(1);
					}
					GL.Translate(Vector3.UnitY);
				}
				GL.PopMatrix();
				GL.Translate(Vector3.UnitX);
			}
			GL.PopMatrix();
		}

	}
}
